<?php

/*
	插件配置文件 (无配置则不需要此文件)
*/

!defined('DEBUG') AND exit('Access Denied.');

if($method == 'GET') {
	$blogs=kv_get('di_blogs');

	include _include(APP_PATH.'plugin/di_blogs/setting.htm'); // 这里包含一个插件配置界面文件
	
} else {
	$data=$_POST;
	$nav=trim(urldecode($data['nav']));
	$nav=str_replace("\r", '', $nav);
	$data['old_nav']=$data['nav'];
	unset($data['nav']);
	$nav_arr=explode("\n",$nav);//导航栏数
	for ($i=0; $i < count($nav_arr) ; $i++) { 
		//获取导航文字
		$data['nav'][$i]['text']=explode("-",$nav_arr[$i])[0];
    	$nav_list_text=explode("-",$nav_arr[$i])[1];
    	$nav_lsit=explode(",",$nav_list_text);
    	$data['nav'][$i]['ids']=$nav_lsit;
  
	}
	
	kv_set('di_blogs',$data);
	message(0,'成功');
}
	
?>